from service.utils.download_file import download_file
import uuid


def get_file_local_path(file_path: str, file_type):
    # 判断是本地文件还是
    if file_path.find("http") != -1:
        file_name = "tmp/" + str(uuid.uuid4()) + "." + file_type
        download_file(file_path, file_name)
        return file_name
    else:
        return file_path
